package com.ruoyi.cart.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Date;

/**
 * 购物车对象 cart
 * 
 * @author sqlstudent
 * @date 2025-06-12
 */
public class Cart extends BaseEntity implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 购物车id */
    private Long cartId;

    /** 用户id */
    @Excel(name = "用户名")
    private String userName;

    /** 产品id */
    @Excel(name = "产品id")
    private Long productId;

    /** 数量 */
    @Excel(name = "数量")
    private Long quantity;

    /** 添加时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date addedDate;

    public void setCartId(Long cartId) 
    {
        this.cartId = cartId;
    }

    public Long getCartId() 
    {
        return cartId;
    }

    public void setUserName(String userName)
    {
        this.userName = userName;
    }

    public String getUserName()
    {
        return userName;
    }

    public void setProductId(Long productId) 
    {
        this.productId = productId;
    }

    public Long getProductId() 
    {
        return productId;
    }

    public void setQuantity(Long quantity) 
    {
        this.quantity = quantity;
    }

    public Long getQuantity() 
    {
        return quantity;
    }

    public void setAddedDate(Date addedDate) 
    {
        this.addedDate = addedDate;
    }

    public Date getAddedDate() 
    {
        return addedDate;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("cartId", getCartId())
            .append("userName", getUserName())
            .append("productId", getProductId())
            .append("quantity", getQuantity())
            .append("addedDate", getAddedDate())
            .toString();
    }
}
